Skip to content

feat(nuxt): support Nuxt 4 and pre-bundle pinia-orm in dev#2047

Merged
CodeDredd merged 2 commits into
mainfrom
feat/nuxt-4
Jul 20, 2026
Merged

feat(nuxt): support Nuxt 4 and pre-bundle pinia-orm in dev#2047
CodeDredd merged 2 commits into
mainfrom
feat/nuxt-4

Conversation

@CodeDredd

@CodeDredd CodeDredd commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Nuxt 4 support

  • @nuxt/kit ^4.5, @nuxt/module-builder ^1, nuxt 4.5 as dev dependency, explicit compatibility: { nuxt: '>=3.14.0' } — the module keeps working on current Nuxt 3 while being first-class on Nuxt 4
  • dev dependencies moved to pinia 4 + @pinia/nuxt 1 (peer range >=0.10.0 unchanged, so Nuxt-3/pinia-3 setups keep resolving)
  • transitive @unhead/vue deduped to a Nuxt-4-compatible version in the lockfile

New feature: automatic dependency optimization

The module now pushes pinia-orm (+ its normalizr chunk) into vite.optimizeDeps.include. This kills the classic dev-server annoyance where vite discovers pinia-orm late and restarts with "new dependencies optimized — reloading". Opt-out: piniaOrm: { optimizeDeps: false }. Documented on the Nuxt setup page.

Playgrounds

  • packages/nuxt/playground and playgrounds/nuxt3 both build green on Nuxt 4.5 (verified locally with nuxi build)
  • playgrounds/nuxt3 bumped to nuxt ^4.5, @pinia/nuxt ^1, pinia ^4, uuid ^11, nanoid ^5

Other ideas considered (not included, possible follow-ups)

  • addImportsDir convention for a ~/models directory (auto-import model classes)
  • auto-registering useAxiosRepo when @pinia-orm/axios is installed
  • shipping a useRepo payload plugin for SSR state transfer tuning

Note: merging this after #2046 (Node 22) produces a trivial package.json conflict (engines field) that gets resolved on merge.

Upgrades the module to @nuxt/kit 4 / module-builder 1 with an explicit
nuxt >=3.14 compatibility range. The module now adds pinia-orm to
vite's optimizeDeps.include (opt-out via piniaOrm.optimizeDeps: false)
to avoid dev server restarts when the first repository is used. Both
playgrounds run on Nuxt 4 with pinia 4 and @pinia/nuxt 1.
@codecov-commenter

codecov-commenter commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.24%. Comparing base (a389d1c) to head (6268183).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2047   +/-   ##
=======================================
  Coverage   99.24%   99.24%           
=======================================
  Files          83       83           
  Lines        3185     3185           
  Branches      562      562           
=======================================
  Hits         3161     3161           
  Misses         17       17           
  Partials        7        7           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CodeDredd
CodeDredd merged commit b414611 into main Jul 20, 2026
10 of 11 checks passed
@CodeDredd
CodeDredd deleted the feat/nuxt-4 branch July 20, 2026 16:29
@github-actions github-actions Bot mentioned this pull request Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants